home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1988 October / Ahoy_Magazine_88-10_1988_Double_L.d64 / Clock Segments (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  1KB  |  40 lines

  1. 0 poke53280,6:poke53281,0
  2. 2 ti$="000000":dimch(23):ul=2:print"[147]"
  3. 3 data2,0,1,4,7,8:data2,3,5,6,9:data5,6,2,4,3,7
  4. 4 fori=0to10:readnm(i):next:restore:fori=0to10:readp$(i):next
  5. 5 fori=0to5:readsa(i):next
  6. 10 forx1=0to2:c1=sa(x1)
  7. 15 forx2=0toul:c2=c1+sa(x2)
  8. 20 forx3=0to3:c3=c2+sa(x3):ifc3>15then55
  9. 25 forx4=0to5:c4=c3+sa(x4):ifc4>17then50
  10. 30 forx5=0to3:c5=c4+sa(x5):ifc5>19then45
  11. 35 forx6=0to5:c6=c5+sa(x6):ifc6=21then70
  12. 40 next
  13. 45 next
  14. 50 next
  15. 55 next
  16. 60 next
  17. 65 ul=5:next:goto200
  18. 70 hn=nm(x1)*10:la=x2:lb=x2:ifx2=0thenla=6:lb=10
  19. 71 ifx2=0andx1=0thenla=6:lb=7
  20. 75 lc=x3:ld=x3:ifx3=0thenlc=6:ld=8
  21. 80 le=x4:lf=x4:ifx4=0thenle=6:lf=10
  22. 85 lg=x5:lh=x5:ifx5=0thenlg=6:lh=8
  23. 90 li=x6:lj=x6:ifx6=0thenli=6:lj=10
  24. 95 fory2=latolb:hc=hn+nm(y2)
  25. 96 fory3=lctold:fory4=le tolf
  26. 98 y5=lg
  27. 99 y6=li
  28. 100 print""p$(x1);p$(y2);":";p$(y3);p$(y4);":";p$(y5);p$(y6)
  29. 101 ch(hc)=ch(hc)+1:cd=cd+1
  30. 102 iflj>y6theny6=y6+1:goto100
  31. 103 iflh>y5theny5=y5+1:goto99
  32. 105 next:next:next:goto40
  33. 200 fori=0to23:printi,ch(i):next:printcd:printti$:end
  34. 300 rem ==================================
  35. 310 rem   commodares problem #52-3 :
  36. 320 rem      clock segments
  37. 330 rem   solution by
  38. 340 rem      craig ewert
  39. 350 rem ==================================
  40.